package com.walixiwa.m3udownloader.model;

import org.json.JSONException;
import org.json.JSONObject;

public class DownloadTaskModel {
    private String url;
    private String name;
    private String speed;
    private String info;
    private int progress;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSpeed() {
        return speed;
    }

    public void setSpeed(String speed) {
        this.speed = speed;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }

    public String toJson() {
        JSONObject jsonObject = null;
        try {
            jsonObject = new JSONObject();
            jsonObject.put("name", name);
            jsonObject.put("url", url);
            jsonObject.put("speed", speed);
            jsonObject.put("info", info);
            jsonObject.put("progress", progress);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jsonObject.toString();
    }
}
